package com.andy.dao;


import java.util.List;

import org.springframework.stereotype.Repository;

import com.andy.dao.base.BaseHibernateDAO;
import com.andy.entity.ExamUser;

@Repository
public class ExamUserDAO extends BaseHibernateDAO<ExamUser> implements IExamUserDAO {
	
	/* (non-Javadoc) 获取所有学生
	 * @see com.andy.dao.IExamUserDAO#getAllStudent()
	 */
	@Override
	@SuppressWarnings("unchecked")
	public List<ExamUser> getAllStudent() {
		final Integer STUDENT_ROLE = 25;
		String hql = " select user from ExamUser user left join user.examRoles role where role.roleId = :studentRole ";
		return this.createQuery(hql).setInteger("studentRole", STUDENT_ROLE).list();
	}

}
